package com.echo.serializer;

import com.echo.model.User;
import com.google.gson.reflect.TypeToken;

import java.util.List;

/**
 * Created by EchoGe on 2016/6/16.
 */
public class UserSerializer extends Serializer {

    //反序列化後的類型
    public Class<?> getDeserializedType() {
        return User.class;
    }



    //反序列化為Category對象
    public Object deserialize(Object data) {
        if(data == null){
            return null;
        }
        return gson.fromJson((String)data,User.class);
    }


}

